<?php

namespace App\Console\Commands;

use App\Services\impl\QgyydqService;
use Illuminate\Console\Command;

class MainCommand extends Command
{
    /**
     * The name and signature of the console command.
     *
     * @var string
     */
    protected $signature = 'main:op {action} {--id=} {--platform=} {--password=} {--value=} {--reason=} ';

    /**
     * The console command description.
     *
     * @var string
     */
    protected $description = 'Command description';

    /**
     * Create a new command instance.
     *
     * @return void
     */
    public function __construct()
    {
        parent::__construct();
    }

    /**
     * Execute the console command.
     *
     * @return mixed
     */
    public function handle()
    {
        //
        $action = $this->argument("action");
        if (method_exists($this, $action)) {
            $this->$action();
            dd("execute $action completed");
        } else {
            dd("not found method : $action");
        }
    }

    public function startQgyydq()
    {
        $service = new QgyydqService();
        $service->start();
    }

    public function autoAddQgyydqItemByName()
    {
        $service = new QgyydqService();
        $service->autoAddQgyydqItemByName();
    }


}
